package com.yao.mall.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yao.mall.model.entity.SpuImage;
import com.yao.mall.model.vo.SpuImageVO;
import com.yao.mall.service.SpuImageService;
import com.yao.mall.mapper.SpuImageMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author jiahua.yao
* @description 针对表【spu_image】的数据库操作Service实现
* @date 2024-03-07 16:45:23
*/
@Service
public class SpuImageServiceImpl extends ServiceImpl<SpuImageMapper, SpuImage>
    implements SpuImageService{

    @Override
    public List<SpuImageVO> toSpuImageVO(List<SpuImage> goodsImageList) {
        return goodsImageList.stream().map(goodsImage -> {
            SpuImageVO goodsImageVO = new SpuImageVO();
            BeanUtils.copyProperties(goodsImage, goodsImageVO);
            return goodsImageVO;
        }).toList();
    }
}




